#include <iostream>
using namespace std;

class A
{
public:
    void eat()
    {
        cout << "A eat" << endl;
    }
protected:
    int _a;
};

class B : public A
{
public:
    virtual void eat()
    {
        cout << "B eat" << endl;
    }
    int _b;
};

int main() {
    A* p = new B;
    delete p;
    return 0;
}
